﻿using Direct.IDAL.Manager;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DirectSell.DAL.Manager
{
    /// <summary>
    /// 管理员登录仓储
    /// </summary>
    public class ManagerLoginRepository:BaseManagerRepository, IManagerLoginRepository
    {
        #region 判断用户名密码
        /// <summary>
        /// 判断用户名密码
        /// </summary>
        /// <returns></returns>
        public bool CheckManager(string code,string password)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(" SELECT COUNT(*) FROM Managers  ");
            sb.AppendFormat(" WHERE ManagerCode='{0}' AND ManagerPassword='{1}' ",code,password);
            return base.QueryFirstT<int>(sb.ToString()) > 0;
        }
        #endregion
    }
}
